YES 2.21 H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:



HASKELL
  ↳ LR

mainModule List
  ((elemIndex :: Char  ->  [Char ->  Maybe Int) :: Char  ->  [Char ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (\vv1 ->
case vv1 of
  (x,i)->  if p x then i : [] else []
  _-> []
) (zip xs (enumFrom 0))


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



Lambda Reductions:
The following Lambda expression
\vv1
case vv1 of
 (x,i) → if p x then i : [] else []
 _ → []

is transformed to
findIndices0 p vv1 = 
case vv1 of
 (x,i) → if p x then i : [] else []
 _ → []

The following Lambda expression
\ab→(a,b)

is transformed to
zip0 a b = (a,b)



↳ HASKELL
  ↳ LR
HASKELL
      ↳ CR

mainModule List
  ((elemIndex :: Char  ->  [Char ->  Maybe Int) :: Char  ->  [Char ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 
case vv1 of
  (x,i)->  if p x then i : [] else []
  _-> []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



Case Reductions:
The following Case expression
case vv1 of
 (x,i) → if p x then i : [] else []
 _ → []

is transformed to
findIndices00 p (x,i) = if p x then i : [] else []
findIndices00 p _ = []



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
HASKELL
          ↳ IFR

mainModule List
  ((elemIndex :: Char  ->  [Char ->  Maybe Int) :: Char  ->  [Char ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,i if p x then i : [] else []
findIndices00 p _ []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



If Reductions:
The following If expression
if p x then i : [] else []

is transformed to
findIndices000 i True = i : []
findIndices000 i False = []



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
HASKELL
              ↳ BR

mainModule List
  ((elemIndex :: Char  ->  [Char ->  Maybe Int) :: Char  ->  [Char ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p _ []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : _) Just a



Replaced joker patterns by fresh variables and removed binding patterns.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
HASKELL
                  ↳ COR

mainModule List
  ((elemIndex :: Char  ->  [Char ->  Maybe Int) :: Char  ->  [Char ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p vw []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : vxJust a



Cond Reductions:
The following Function with conditions
undefined 
 | False
 = undefined

is transformed to
undefined  = undefined1

undefined0 True = undefined

undefined1  = undefined0 False



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
HASKELL
                      ↳ NumRed

mainModule List
  ((elemIndex :: Char  ->  [Char ->  Maybe Int) :: Char  ->  [Char ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom 0))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p vw []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : vxJust a



Num Reduction: All numbers are transformed to thier corresponding representation with Pos, Neg, Succ and Zero.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
HASKELL
                          ↳ Narrow

mainModule List
  (elemIndex :: Char  ->  [Char ->  Maybe Int)

module List where
  import qualified Maybe
import qualified Prelude

  elemIndex :: Eq a => a  ->  [a ->  Maybe Int
elemIndex x findIndex (== x)

  findIndex :: (a  ->  Bool ->  [a ->  Maybe Int
findIndex p Maybe.listToMaybe . findIndices p

  findIndices :: (a  ->  Bool ->  [a ->  [Int]
findIndices p xs concatMap (findIndices0 p) (zip xs (enumFrom (Pos Zero)))

  
findIndices0 p vv1 findIndices00 p vv1

  
findIndices00 p (x,ifindIndices000 i (p x)
findIndices00 p vw []

  
findIndices000 i True i : []
findIndices000 i False []


module Maybe where
  import qualified List
import qualified Prelude

  listToMaybe :: [a ->  Maybe a
listToMaybe [] Nothing
listToMaybe (a : vxJust a



Haskell To QDPs


↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
                        ↳ HASKELL
                          ↳ Narrow
                            ↳ AND
QDP
                                ↳ QDPSizeChangeProof
                              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_listToMaybe(Char(Succ(wx411000)), :(wx41110, wx41111), wx18, wx17) → new_listToMaybe(wx41110, wx41111, new_primPlusNat(wx18), new_primPlusNat(wx18))

The TRS R consists of the following rules:

new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wx1800)) → Succ(wx1800)
new_primPlusNat(Succ(wx180)) → Succ(Succ(new_primPlusNat0(wx180)))
new_primPlusNat0(Zero) → Zero

The set Q consists of the following terms:

new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat0(Succ(x0))
new_primPlusNat(Succ(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ CR
        ↳ HASKELL
          ↳ IFR
            ↳ HASKELL
              ↳ BR
                ↳ HASKELL
                  ↳ COR
                    ↳ HASKELL
                      ↳ NumRed
                        ↳ HASKELL
                          ↳ Narrow
                            ↳ AND
                              ↳ QDP
QDP
                                ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

new_listToMaybe2(wx31, wx34, :(wx350, wx351), wx36) → new_listToMaybe1(wx34, wx350, wx351, wx36, wx36)
new_listToMaybe0(wx31, Zero, Succ(wx330), wx34, wx35, wx36) → new_listToMaybe2(wx31, wx34, wx35, wx36)
new_listToMaybe1(wx300, Char(wx41100), wx4111, wx16, wx15) → new_listToMaybe0(new_primPlusNat(wx16), Succ(wx300), wx41100, wx300, wx4111, new_primPlusNat(wx16))
new_listToMaybe0(wx31, Succ(wx320), Zero, wx34, :(wx350, wx351), wx36) → new_listToMaybe1(wx34, wx350, wx351, wx36, wx36)
new_listToMaybe0(wx31, Succ(wx320), Succ(wx330), wx34, wx35, wx36) → new_listToMaybe0(wx31, wx320, wx330, wx34, wx35, wx36)

The TRS R consists of the following rules:

new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(wx1800)) → Succ(wx1800)
new_primPlusNat(Succ(wx180)) → Succ(Succ(new_primPlusNat0(wx180)))
new_primPlusNat0(Zero) → Zero

The set Q consists of the following terms:

new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat0(Succ(x0))
new_primPlusNat(Succ(x0))

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: